package org.lmind.scale.study

class Point[X, Y](x1:X, y1:Y) {
  def x = x1
  def y = y1
}

object AbstractType {
  
  abstract class Buffer {
    type T; val element: T
  }
  abstract class SeqBuffer {
    type T; val element: Seq[T]; def length = element.length
  }

  def newIntBuffer(el: Int) = new Buffer {
    type T = Int; val element = el
  }
  def newIntBuffer(el: Int*) = new SeqBuffer {
    type T = Int; val element = el
  }
  println(newIntBuffer(1).element)
  println(newIntBuffer(1, 2, 3).length)
  
  var pt = new Point[Int, Int](1, 2)
  println(pt.x)
  
  def f():Int = {
    return 1
  }
}